<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>画一个会动的八卦</title>
        <style>
            body {
                background: #ddd;
            }

            * {
                box-sizing: border-box;
                /* 改变盒模型 */
                padding: 0;
                margin: 0;
            }

            @keyframes x {
                from {
                    transform: rotate(0deg);
                }

                to {
                    transform: rotate(360deg);
                }
            }

            #bagua {
                /* 园外形 */
                width: 400px;
                height: 400px;
                border-radius: 50%;
                position: relative;
                overflow: hidden;
                animation: x 10s infinite linear;
                /* css3 动画 */
                box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75);
                /* box shadow generator */
            }

            @media (max-width: 500px) {

                /* 媒体查询 小于500px的设备 增加以下属性 */
                #bagua {
                    width: 200px;
                    height: 200px;
                }
            }

            #bagua>div:first-child {
                /* 左边黑色部分 */
                width: 50%;
                height: 100%;
                position: absolute;
                left: 0;
                background: black;
            }

            #bagua>div:nth-child(2) {
                /* 右边白色部分 */
                width: 50%;
                height: 100%;
                position: absolute;
                right: 0;
                background: white;
            }

            #bagua>div:nth-child(3) {
                /* 上边黑色的圆*/
                position: absolute;
                width: 200px;
                height: 200px;
                left: 50%;
                margin-left: -100px;
                border-radius: 50%;
                background: black;
            }

            @media (max-width: 500px) {
                #bagua>div:nth-child(3) {
                    width: 100px;
                    height: 100px;
                    margin-left: -50px;
                }
            }

            #bagua>div:nth-child(4) {
                /* 下边白色的圆 */
                position: absolute;
                width: 200px;
                height: 200px;
                bottom: 0%;
                border-radius: 50%;
                left: 50%;
                margin-left: -100px;
                background: white;
            }

            @media (max-width: 500px) {
                #bagua>div:nth-child(4) {
                    width: 100px;
                    height: 100px;
                    margin-left: -50px;
                }
            }

            #bagua>div:nth-child(5) {
                /* 上边小白圆 */
                position: absolute;
                width: 50px;
                height: 50px;
                left: 50%;
                top: 75px;
                margin-left: -25px;
                border-radius: 50%;
                background: white;
            }

            @media(max-width :500px) {
                #bagua>div:nth-child(5) {
                    border: 1px solid red;
                    width: 25px;
                    height: 25px;
                    top: 37.5px;
                    margin-left: -12.5px;
                }
            }

            #bagua>div:nth-child(6) {
                /* 下边小黑圆 */
                position: absolute;
                width: 50px;
                height: 50px;
                left: 50%;
                bottom: 50px;
                margin-left: -25px;
                border-radius: 50%;
                background: black;
            }

            @media(max-width: 500px) {
                #bagua>div:nth-child(6) {
                    width: 25px;
                    height: 25px;
                    bottom: 37.5px;
                    margin-left: -12.5px;
                }
            }

            #bagua_wrapper {
                border: 10px solid red;
                height: 100vh;
                /* viewpoint height 用户可以看见页面的高度 */
                display: flex;
                justify-content: center;
                align-items: center;
                flex-direction: column;
            }

            #bagua-description {
                margin-top: 1em;
            }
        </style>
    </head>

    <body>
        <div id="bagua_wrapper">
            <div id="bagua">
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </div>
            <div id="bagua-description"> daokedao,feichangdao </div>
        </div>
    </body>

</html>